import request from "@/util/request";

// 获取用户信息
export const getUserInfo = (user) => {
    return request({
        url: "user/h_login",
        method: "post",
        data: user
    })
}

// 获取用户列表
export const getUserList = (username, pageNum, pageSize) => {
    return request({
        url: "user",
        method: "get",
        params: {
            username,
            pageNum,
            pageSize
        }
    })
}

// 添加用户
export const addUserRequestApi = (data) => {
    return request({
        url: "user",
        method: "post",
        data
    })
}

// 修改用户
export const updataUserRequestApi = (data) => {
    return request({
        url: "user",
        method: "put",
        data
    })
}

// 删除用户
export const deleteUserRequestApi = (id) => {
    return request({
        url: "user/" + id,
        method: "delete",
    })
}